package leetcode.code0274;

import java.util.Arrays;

public class Solution1 extends Solution274 {

	@Override
	public int hIndex(int[] citations) {
		Arrays.sort(citations);
		int n = citations.length;
		int h = 0;
		for (int i = n - 1; i >= 0; i--) {
			if (citations[i] >= n - i) {
				h = n - i;
			}
		}
		return h;
	}

	public static void main(String[] args) {
		Solution1 so = new Solution1();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();
		so.debug5();
		so.debug6();

	}

}
